import request from '@/config/axios'

// 提现记录 VO
export interface CashApplyVO {
  id: number // 主键
  memberId: number // 会员ID
}

// 提现记录 API
export const CashApplyApi = {
  // 查询提现记录分页
  getCashApplyPage: async (params: any) => {
    return await request.get({ url: `/wo/cash-apply/page`, params })
  },

  // 查询提现记录详情
  getCashApply: async (id: number) => {
    return await request.get({ url: `/wo/cash-apply/get?id=` + id })
  },

  // 新增提现记录
  createCashApply: async (data: CashApplyVO) => {
    return await request.post({ url: `/wo/cash-apply/create`, data })
  },

  // 修改提现记录
  updateCashApply: async (data: CashApplyVO) => {
    return await request.put({ url: `/wo/cash-apply/update`, data })
  },

  // 修改提现记录
  confirmCashApply: async (data: number) => {
    return await request.put({ url: `/wo/cash-apply/confirm`, data })
  },

  // 删除提现记录
  deleteCashApply: async (id: number) => {
    return await request.delete({ url: `/wo/cash-apply/delete?id=` + id })
  },

  // 导出提现记录 Excel
  exportCashApply: async (params) => {
    return await request.download({ url: `/wo/cash-apply/export-excel`, params })
  }
}
